<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<html>
<head>
    <meta charset="utf-8">
    <title>（事务审批）部门岗位变动 - 部门岗位变动审批表</title>
    <link rel="stylesheet" href="../../dist/css/layui.css">
    <script src="../../dist/layui.js"></script>
    <script src="../../dist/jquery-1_8_3.js"></script>
</head>
<body>
<form class="layui-form">
    <div class="layui-form-item" style="width: 300px">
        <div class="layui-input-block">
            <label>
                <%-- 传入的student_work_motion的id --%>
                <input type="text" name="id" value='${param.id}' hidden>
            </label>
        </div>
    </div>
    <div class="layui-form-item" style="width: 300px">
        <div class="layui-input-block">
            <label>
                <%--job_type --%>
                <input type="text" name="type" value='${param.type}' hidden>
            </label>
        </div>
    </div>
    <!-- 管理员意见 -->
    <div class="layui-form-item">
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">意见:</label>
            <div class="layui-input-block">
                <label>
                    <textarea name="advice" placeholder="请输入内容" class="layui-textarea" lay-verify="required"></textarea>
                </label>
            </div>
        </div>
    </div>

    <!-- 操作，单选框 -->
    <div class="layui-form-item">
        <label class="layui-form-label">操作:</label>
        <div class="layui-input-block">
            <input type="radio" name="operation" value="1" title="批准" checked>
            <input type="radio" name="operation" value="-1" title="拒绝">
        </div>
    </div>

    <!-- 提交 -->
    <div style="margin-top: 30px">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal layui-block" lay-submit hidden="">提交</button>
        </div>
    </div>
</form>

<script>
    layui.use(['layer', 'form'], function(){
        var layer = layui.layer
            ,form = layui.form
            ,$ = layui.jquery;

        form.on('submit()',function(data){

            $.ajax({
                url:'/admin/handleDeptJobWorkMotion',
                async: false,
                type:'post',
                data:data.field,
                // 是否使用传统的方式浅层序列化,若有数组参数或对象参数需要设置true
                traditional: true,
                dataType:'JSON',
                success:function(result){
                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    // 关闭父级弹出层
                    parent.layer.close(index);
                    parent.parent.layer.msg("已处理！",{icon:1,time:1000});
                    // 刷新父页面
                    parent.location.reload();
                }
            });
            return false;//组织表单默认提交并跳转
        });
    });
</script>
</body>
</html>
